﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CarCrash.Core.Services;
using CarCrash.Core.Model;

namespace CarCrash.Application.Forms
{
    public partial class AutoCatalog : Form
    {
        public AutoCatalog()
        {
            InitializeComponent();
            var service = VehicleService.Instance;
            service.OpenSession();
            dgVehicles.AutoGenerateColumns = false;
            dgVehicles.DataSource = service.GetAll();
            dgVehicles.EditMode = DataGridViewEditMode.EditProgrammatically;
            service.CloseSession();
        }

    }
}
